package org.maxkey.portal.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Date;

/**
 * 用户实体类
 *  Mr.shi
 */
@Entity
@Table(
        name = "MXKP_DOC",
        indexes = {
                @Index(name = "TITLE",  columnList="TITLE", unique = true)})
@ToString
@Getter
@Setter
@SuppressWarnings("serial")
public class Doc implements java.io.Serializable{

    /**
     * 声明主键
     * 声明主键的自增策略
     */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "ID")
    @GenericGenerator(name = "ID", strategy = "org.maxkey.portal.core.db.MIdentityGenerator")
    @Column(name="ID")
    //@ApiModelProperty(value="唯一标识")
    private Integer id;

    /**
     * 文档编号
     */
    @Column(length = 200,name="SN")
    private String sn;

    /**
     * 标题
     */
    @Column(length = 200,name="TITLE")
    private String title;

    /**
     * 内容
     */
    @Column(name="CONTENT",columnDefinition="text")
    //@ApiModelProperty(value="密码")
    private String content;


    /**
     * 发布人ID
     */
    @Column(length = 20,name="USER_ID")
    // @ApiModelProperty(value="姓名")
    private Integer userid;

    /**
     * 类型
     */
    @Column(name="TYPE")
    private Integer type;



    /**
     * 发布人
     */
    @Column(length = 20,name="USER_NAME")
   // @ApiModelProperty(value="姓名")
    private String username;


    /**
     * 版本
     */
    @Column(length = 20,name="VERSION")
    private String version;

    /**
     * 权限
     */
    @Column(length = 20,name="ROLE")
    private String role;

    /**
     * 状态
     */
    @Column(length = 3,name="STATUS")
    private Integer status;

    /**
     * 点击率
     */
    @Column(name="ONCLOCK_NUM")
    private Integer onclickNum;


    /**
     * 发布时间
     */
    @Column(name="PUBLIC_TIME")
    @JsonFormat(shape= JsonFormat.Shape.STRING,pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date publicTime;


    /**
     * 创建时间
     */
    @Column(name="CREATE_TIME")
    @JsonFormat(shape= JsonFormat.Shape.STRING,pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createTime;

    /**
     * 修改时间
     */
    @Column(name="UPDATE_TIME")
    @JsonFormat(shape= JsonFormat.Shape.STRING,pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date updateTime;


}
